// 导入 slice 切片  configure 配置  store 仓库
import {configureStore} from '@reduxjs/toolkit';
//导入
import countReducer from './slices/countSlice';
import zanReducer from './slices/zanSlice';
import todoReducer from './slices/todoSlice';

// 配置 store 对象
let store = configureStore({
  reducer: {
    count: countReducer,
    zan: zanReducer,
    todo: todoReducer
  }
});

//暴露 store
export default store;

//测试使用
//获取状态
// console.log(store.getState());

//添加订阅
// store.subscribe(() => {
//   console.log('状态发生了改变....');
// });

// //更新状态
// store.dispatch(add(10));

// //获取状态
// console.log(store.getState());
